//
//  GKShareManger.m
//  jinwan
//
//  Created by GKiOS on 2017/6/7.
//  Copyright © 2017年 wy. All rights reserved.
//

#import "GKShareManger.h"

NSString *const UM_Share_Key = @"5a0d2ec0f29d983922000085";//UMeng Key

NSString *const UM_Share_WeiBo_Key = @"127633930";//微博
NSString *const UM_Share_WeiBo_Secret = @"44bd0b9eacc2777050de21abdb9235c3";
NSString *const UM_Share_WeiBo_RegirectURL = /*@"http://sns.whalecloud.com/sina2/callback"*/nil;

NSString *const UM_Share_Wechat_Key = @"wx3dc7b15b34680365";//微信
NSString *const UM_Share_Wechat_Secret = @"9da010dc717a5f2dc997bc41e4d21732";

NSString *const UM_Share_QQ_Key = @"1106464617";//QQ
NSString *const UM_Share_TenXun_RegirectURL = /*@"http://mobile.umeng.com/social"*/nil;

@implementation GKShareManger
+ (void)confingureShare
{
    [[UMSocialManager defaultManager] openLog:YES];
    [[UMSocialManager defaultManager] setUmSocialAppkey:UM_Share_Key];
    [self configUSharePlatforms];
    [self confitUShareSettings];
}

+ (void)configUSharePlatforms
{
    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_Sina appKey:UM_Share_WeiBo_Key  appSecret:UM_Share_WeiBo_Secret redirectURL:UM_Share_WeiBo_RegirectURL];
    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:UM_Share_QQ_Key  appSecret:nil redirectURL:UM_Share_TenXun_RegirectURL];
    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_Qzone appKey:UM_Share_QQ_Key  appSecret:nil redirectURL:UM_Share_TenXun_RegirectURL];
    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatTimeLine appKey:UM_Share_Wechat_Key  appSecret:UM_Share_Wechat_Secret redirectURL:UM_Share_TenXun_RegirectURL];
    [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatSession appKey:UM_Share_Wechat_Key  appSecret:UM_Share_Wechat_Secret redirectURL:UM_Share_TenXun_RegirectURL];
}

+ (void)confitUShareSettings
{
    /*
     * 打开图片水印
     */
    //[UMSocialGlobal shareInstance].isUsingWaterMark = YES;
    
    /*
     * 关闭强制验证https，可允许http图片分享，但需要在info.plist设置安全域名
     <key>NSAppTransportSecurity</key>
     <dict>
     <key>NSAllowsArbitraryLoads</key>
     <true/>
     </dict>
     */
    [UMSocialGlobal shareInstance].isUsingHttpsWhenShareContent = NO;
}
@end
